home *** CD-ROM | disk | FTP | other *** search
/ Belgian Amiga Club - ADF Collection / BS1 part 26.zip / BS1 part 26 / Aztec C v5.2a disk 4.adf / 204inc_h.lzh / devices / narrator.h < prev    next >
C/C++ Source or Header  |  1991-03-14  |  5KB  |  142 lines

  1. #ifndef DEVICES_NARRATOR_H
  2. #define DEVICES_NARRATOR_H
  3. /*
  4. **    $Filename: devices/narrator.h $
  5. **    $Release: 2.04 $
  6. **    $Revision: 1.7 $
  7. **    $Date: 91/03/12 $
  8. **
  9. **    V37 Narrator device C language include file
  10. **
  11. **    Copyright 1990, 1991 Joseph Katz/Mark Barton.
  12. **    All rights reserved.
  13. **
  14. **    This include file (narrator.h) may be freely distributed
  15. **    as long as the above copyright notice remains intact.
  16. **
  17. */
  18.  
  19.  
  20. #ifndef EXEC_IO_H
  21. #include "exec/io.h"
  22. #endif
  23.  
  24.  
  25.         /*        Device Options    */
  26.  
  27. #define NDB_NEWIORB    0    /* Use new extended IORB        */
  28. #define NDB_WORDSYNC    1    /* Generate word sync messages        */
  29. #define NDB_SYLSYNC    2    /* Generate syllable sync messages    */
  30.  
  31.  
  32. #define NDF_NEWIORB    (1 << NDB_NEWIORB)
  33. #define NDF_WORDSYNC    (1 << NDB_WORDSYNC)
  34. #define NDF_SYLSYNC    (1 << NDB_SYLSYNC)
  35.  
  36.  
  37.  
  38.         /*        Error Codes        */
  39.  
  40. #define ND_NoMem    -2    /* Can't allocate memory        */
  41. #define ND_NoAudLib    -3    /* Can't open audio device        */
  42. #define ND_MakeBad    -4    /* Error in MakeLibrary call        */
  43. #define ND_UnitErr    -5    /* Unit other than 0            */
  44. #define ND_CantAlloc    -6    /* Can't allocate audio channel(s)    */
  45. #define ND_Unimpl    -7    /* Unimplemented command        */
  46. #define ND_NoWrite    -8    /* Read for mouth without write first    */
  47. #define ND_Expunged    -9    /* Can't open, deferred expunge bit set    */
  48. #define ND_PhonErr     -20    /* Phoneme code spelling error            */
  49. #define ND_RateErr     -21    /* Rate out of bounds            */
  50. #define ND_PitchErr    -22    /* Pitch out of bounds                */
  51. #define ND_SexErr      -23    /* Sex not valid            */
  52. #define ND_ModeErr     -24    /* Mode not valid            */
  53. #define ND_FreqErr     -25    /* Sampling frequency out of bounds    */
  54. #define ND_VolErr      -26    /* Volume out of bounds        */
  55. #define ND_DCentErr    -27    /* Degree of centralization out of bounds */
  56. #define ND_CentPhonErr -28    /* Invalid central phon            */
  57.  
  58.  
  59.  
  60.         /* Input parameters and defaults */
  61.  
  62. #define DEFPITCH    110        /* Default pitch            */
  63. #define DEFRATE     150        /* Default speaking rate (wpm)            */
  64. #define DEFVOL        64        /* Default volume (full)        */
  65. #define DEFFREQ     22200    /* Default sampling frequency (Hz)    */
  66. #define MALE        0        /* Male vocal tract            */
  67. #define FEMALE        1        /* Female vocal tract            */
  68. #define NATURALF0   0        /* Natural pitch contours        */
  69. #define ROBOTICF0   1        /* Monotone pitch            */
  70. #define MANUALF0    2        /* Manual setting of pitch contours    */
  71. #define DEFSEX        MALE    /* Default sex                    */
  72. #define DEFMODE     NATURALF0    /* Default mode            */
  73. #define    DEFARTIC    100        /* 100% articulation (normal)        */
  74. #define DEFCENTRAL  0        /* No centralization            */
  75. #define DEFF0PERT   0        /* No F0 Perturbation            */
  76. #define DEFF0ENTHUS 32        /* Default F0 enthusiasm (in 32nds)    */
  77. #define DEFPRIORITY 100        /* Default speaking priority        */
  78.  
  79.  
  80.             /*    Parameter bounds    */
  81.  
  82. #define MINRATE     40        /* Minimum speaking rate        */
  83. #define MAXRATE     400        /* Maximum speaking rate        */
  84. #define MINPITCH    65        /* Minimum pitch            */
  85. #define MAXPITCH    320        /* Maximum pitch            */
  86. #define MINFREQ     5000    /* Minimum sampling frequency        */
  87. #define MAXFREQ     28000    /* Maximum sampling frequency        */
  88. #define MINVOL        0        /* Minimum volume            */
  89. #define MAXVOL        64        /* Maximum volume            */
  90. #define MINCENT      0        /* Minimum degree of centralization    */
  91. #define MAXCENT    100        /* Maximum degree of centralization    */
  92.  
  93.  
  94.         /*    Standard Write request    */
  95.  
  96. struct narrator_rb {
  97.     struct IOStdReq  message;    /* Standard IORB        */
  98.     UWORD    rate;            /* Speaking rate (words/minute) */
  99.     UWORD    pitch;            /* Baseline pitch in Hertz        */
  100.     UWORD    mode;            /* Pitch mode            */
  101.     UWORD    sex;            /* Sex of voice            */
  102.     UBYTE    *ch_masks;        /* Pointer to audio alloc maps    */
  103.     UWORD    nm_masks;        /* Number of audio alloc maps    */
  104.     UWORD    volume;            /* Volume. 0 (off) thru 64    */
  105.     UWORD    sampfreq;        /* Audio sampling freq            */
  106.     UBYTE    mouths;            /* If non-zero, generate mouths */
  107.     UBYTE    chanmask;        /* Which ch mask used (internal)*/
  108.     UBYTE    numchan;        /* Num ch masks used (internal) */
  109.     UBYTE    flags;            /* New feature flags        */
  110.     UBYTE    F0enthusiasm;        /* F0 excursion factor        */
  111.     UBYTE    F0perturb;        /* Amount of F0 perturbation    */
  112.     BYTE    F1adj;            /* F1 adjustment in ±5% steps    */
  113.     BYTE    F2adj;                /* F2 adjustment in ±5% steps    */
  114.     BYTE    F3adj;            /* F3 adjustment in ±5% steps    */
  115.     BYTE    A1adj;            /* A1 adjustment in decibels    */
  116.     BYTE    A2adj;            /* A2 adjustment in decibels    */
  117.     BYTE    A3adj;            /* A3 adjustment in decibels    */
  118.     UBYTE    articulate;        /* Transition time multiplier    */
  119.     UBYTE    centralize;        /* Degree of vowel centralization */
  120.     char    *centphon;        /* Pointer to central ASCII phon  */
  121.     BYTE    AVbias;            /* AV bias            */
  122.     BYTE    AFbias;            /* AF bias            */
  123.     BYTE    priority;        /* Priority while speaking    */
  124.     BYTE    pad1;            /* For alignment        */
  125.     };
  126.  
  127.  
  128.  
  129.         /*    Standard Read request    */
  130.  
  131. struct mouth_rb {
  132.     struct    narrator_rb voice;    /* Speech IORB            */
  133.     UBYTE    width;            /* Width (returned value)    */
  134.     UBYTE    height;            /* Height (returned value)    */
  135.     UBYTE    shape;            /* Internal use, do not modify    */
  136.     UBYTE    sync;            /* Returned sync events        */
  137.     };
  138.  
  139.  
  140.  
  141. #endif    /* DEVICES_NARRATOR_H */
  142.